/// 圈子数据模型
/// 表示一个用户圈子
class CircleEssence {
  final String id;
  final String image;
  final String title;

  CircleEssence({required this.id, required this.image, required this.title});

  /// 从Map创建CircleEssence
  factory CircleEssence.fromMap(Map<String, dynamic> map) {
    return CircleEssence(
      id: map['id'] as String,
      image: map['image'] as String,
      title: map['title'] as String,
    );
  }

  /// 转换为Map
  Map<String, dynamic> toMap() {
    return {'id': id, 'image': image, 'title': title};
  }

  /// 复制并修改部分属性
  CircleEssence copyWith({String? id, String? image, String? title}) {
    return CircleEssence(
      id: id ?? this.id,
      image: image ?? this.image,
      title: title ?? this.title,
    );
  }
}
